#include <SGE.h>

using namespace SGE;

SGE_Sprite sprite;
SVector2 position;
bool quit = false;

void SGE_Initialize ()
{
	sprite.Load ("8bit_link.png");
}

void SGE_Terminate ()
{
	sprite.Unload ();
}

bool SGE_Update (float deltaTime)
{
	const float kSpeed = 100.0f;

	if (Input_IsKeyDown (Keys::RIGHT))
	{
		position.x += (kSpeed * deltaTime);
	}
	else if (Input_IsKeyDown (Keys::LEFT))
	{
		position.x -= (kSpeed * deltaTime);
	}

	if (Input_IsKeyDown (Keys::UP))
	{
		position.y -= (kSpeed * deltaTime);
	}
	else if (Input_IsKeyDown (Keys::DOWN))
	{
		position.y += (kSpeed * deltaTime);
	}

	if (Input_IsKeyPressed (Keys::ESCAPE))
	{
		quit = true;
	}

	return quit;
}

void SGE_Render ()
{
	sprite.SetPosition (position);
	sprite.Render ();
}